package me.baicai.weixin.entity.gcb;

import org.springframework.data.domain.AbstractPageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;


/**
 * @author : AdinZ  1454269@qq.com
 * @Project: Common
 * @Package com.xianxian.basic.entity
 * @Description: TODO
 * @date Date : 2018年11月12日 16:48
 **/

public class PageEntity extends AbstractPageRequest {
    private Sort sort;


    public PageEntity(int page, int size) {
        super(page-1, size);
        this.sort= Sort.unsorted();
    }

    @Override
    public Pageable next() {
        return null;
    }

    @Override
    public Pageable previous() {
        return null;
    }

    @Override
    public Pageable first() {
        return null;
    }


    public PageEntity(int page, int size, Sort.Direction direction, String... properties) {

        this(page, size, Sort.by(direction, properties));
    }
    private PageEntity(int page, int size, Sort sort) {
        this(page, size);
        this.sort = sort;
    }

    @Override
    public Sort getSort() {
        return this.sort;
    }


}
